﻿namespace ConsoleApp1.advance;

public class a11_thread
{
    public static void TestMain(){
        Thread th = Thread.CurrentThread;
        th.Name = "MainThread";
        Console.WriteLine("This is {0}", th.Name);
        Console.ReadKey();
    }
}

class ThreadCreationProgram{
    public static void CallToChildThread(){
        Console.WriteLine("Child thread starts");
    }
        
    public static void TestMain(){
        ThreadStart childref = new ThreadStart(CallToChildThread);
        Console.WriteLine("In Main: Creating the Child thread");
        Thread childThread = new Thread(childref);
        childThread.Start();
        Console.ReadKey();
    }
}